package org.anderground.internal.graphics.impl;

import org.anderground.internal.graphics.abstaractions.AbstractBitmap;
import org.anderground.internal.graphics.abstaractions.Delegator;

import android.graphics.Bitmap;

public class AndroidBitmap extends Delegator<Bitmap> implements AbstractBitmap {

	public static android.graphics.Bitmap.Config castConfig(Config aConfig) {
		android.graphics.Bitmap.Config config;

		if (aConfig == Config.ARGB_4444) {
			config = android.graphics.Bitmap.Config.ARGB_4444;
		} else if (aConfig == Config.ARGB_8888) {
			config = android.graphics.Bitmap.Config.ARGB_8888;
		} else {
			config = android.graphics.Bitmap.Config.RGB_565;
		}

		return config;
	}

	public static Bitmap castBitmap(AbstractBitmap b) {
		return ((AndroidBitmap) b).getDelegate();
	}

	public void eraseColor(int c) {
		getDelegate().eraseColor(c);
	}

	public AndroidBitmap(Bitmap bitmap) {
		setDelegate(bitmap);
	}

}
